package com.org.controller.login;

import com.org.entity.LoginRequest;
import com.org.service.LoginService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;


/**
 * @author Rainy-Heights
 * @version 1.0
 * @Date 2023/3/6 21:39
 */
@Controller
public class LoginController {


//    LoginService loginService;//一般使用接口来完成，而不是实现类
    //登录页面
    @RequestMapping("/auth-login")
    public String login() throws Exception {
        return "/auth-login";
    }
//    @RequestMapping("/loginProcess")
//    public String loginImpl(@ModelAttribute("loginRequest") LoginRequest loginRequest) throws Exception {
//        System.out.println(loginRequest.getPassword());
//        System.out.println(loginRequest.getUsername());
//        if (loginService.getLoginOrNot(loginRequest)){
//            return "redirect:/page/index";
//        }
//        return "auth-login.html";
//    }
//
    //登出
    @RequestMapping("/auth-logout")
    public String logout(){
        return "/auth-logout";
    }
}
